﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master"
    CodeBehind="imageAddComments.aspx.vb" Inherits="VW_Passat_Community.imageAddComments" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <div>
            <div id="bluecontent" style="font-size: small; font-weight: normal; font-style: normal">
                <h1 class="headline3">
                    Image Comments</h1>
                Here is a chance for you to comment on images! Please feel free to share your views.
                <br />
                <br />
                Simply enter your comment below and press comment. You can also place several tags
                on the picture by selecting your preffered tags and clicking on tag image. If you
                cant find a tag which your looking for, enter it in the filed below and click on
                add new tag. It&#39;s simple as that!
                <br />
            </div>
            <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource3" Height="139px"
                Width="370px">
                <EditItemTemplate>
                    <strong>Description:</strong>
                    <asp:TextBox ID="ImageDescriptionTextBox" runat="server" Text='<%# Bind("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:TextBox ID="DateUploadedTextBox" runat="server" Text='<%# Bind("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:TextBox ID="TimeUploadedTextBox" runat="server" Text='<%# Bind("TimeUploaded") %>' />
                    <br />
                    <strong>Uploaded by:</strong> <a href="UserProfile.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                        Text="Update" />
                    <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                        Text="Cancel" />
                </EditItemTemplate>
                <InsertItemTemplate>
                    <strong>Description:</strong>
                    <asp:TextBox ID="ImageDescriptionTextBox0" runat="server" Text='<%# Bind("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:TextBox ID="DateUploadedTextBox0" runat="server" Text='<%# Bind("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:TextBox ID="TimeUploadedTextBox0" runat="server" Text='<%# Bind("TimeUploaded") %>' />
                    <br />
                    <strong>Uploaded by:</strong> <a href="UserProfile.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                        Text="Insert" />
                    &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                        CommandName="Cancel" Text="Cancel" />
                </InsertItemTemplate>
                <ItemTemplate>
                    <strong>Description:</strong>
                    <asp:Label ID="ImageDescriptionLabel" runat="server" Text='<%# Bind("ImageDescription") %>' />
                    <br />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" Text='<%# Bind("DateUploaded") %>' />
                    <br />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" Text='<%# Bind("TimeUploaded") %>' />
                    <br />
                    <br />
                    <strong>Uploaded by:</strong> <a href="UserProfile.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                </ItemTemplate>
            </asp:FormView>
            <br />
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT Images.ImageDescription, Images.DateUploaded, Images.TimeUploaded, aspnet_Users.UserName, Images.ImageID FROM (Images INNER JOIN aspnet_Users ON Images.UserIDFK = aspnet_Users.UserId) WHERE (Images.ImageID = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="?" QueryStringField="ID" />
                </SelectParameters>
            </asp:SqlDataSource>
        </div>
        <div>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
                Height="77px" PageSize="1" Width="362px" CssClass="content2">
                <Columns>
                    <asp:ImageField DataAlternateTextField="ImageLink" DataImageUrlField="ImageLink">
                        <ControlStyle CssClass="carImageBig" />
                        <FooterStyle CssClass="carImageBig" />
                        <ItemStyle CssClass="carImageBig" />
                    </asp:ImageField>
                </Columns>
            </asp:GridView>
        </div>
        <div>
            <div>
            </div>
            <asp:Image ID="imgLike" runat="server" Height="35px" ImageUrl="/Images/imgLiked.jpg"
                Style="text-align: center" Width="55px" />
            <asp:Label ID="lblTotalCounts" runat="server" Text="Label" Font-Size="Medium" BorderStyle="Inset"
                Width="57px"></asp:Label>
            <div class="replaceLikeButton">
                <asp:Button ID="btnLike" runat="server" Height="30px" Style="text-align: left" Text="Like This Image"
                    Width="133px" Font-Bold="True" Font-Italic="True" CssClass="buttons" />
            </div>
        </div>
        <div>
            <div>
                <br />
                <h2 class="headline5">
                    Comments</h2>
                <div>
                    To add a comment to this image, simply enter your comment below and click comment.<div
                        class="commentTexBox">
                        <asp:TextBox ID="txtimagecomment" runat="server" BorderStyle="Solid" Height="77px"
                            Width="481px" TextMode="MultiLine"></asp:TextBox>
                        <asp:Button ID="btncomment" runat="server" Text="Comment" Width="93px" CssClass="buttons"
                            Height="33px" />
                        <br />
                        <br />
                        <div>
                            <div id="displayright">
                                <h2 class="headline5">
                                    Current Tags</h2>
                                <div class="tags">
                                    <div class="listOfAssignedTags">
                                        <div class="postTagsInfo">
                                            <span class="style2">Below are the tags currently tagged on the image shown above</span>.
                                        </div>
                                        <asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource5" DataTextField="TagName"
                                            DataValueField="TagName" Height="99px" Width="269px" SelectionMode="Multiple"
                                            Font-Names="Calibri" Font-Size="Medium"></asp:ListBox>
                                        <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                                            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT Tags.TagName, Image_Tags.ImageIDFK, Image_Tags.ID FROM (Tags INNER JOIN Image_Tags ON Tags.TagID = Image_Tags.TagIDFK) WHERE (Image_Tags.ImageIDFK = ?) ORDER BY Image_Tags.ID DESC">
                                            <SelectParameters>
                                                <asp:QueryStringParameter Name="?" QueryStringField="id" />
                                            </SelectParameters>
                                        </asp:SqlDataSource>
                                    </div>
                                    <h2 class="headline5">
                                        Tag the Photo</h2>
                                    <asp:Panel ID="Panel1" runat="server" Height="114px" ScrollBars="Vertical" Width="257px">
                                        <asp:CheckBoxList ID="cbxtags" runat="server" DataSourceID="SqlDataSource4" DataTextField="TagName"
                                            DataValueField="TagID" RepeatLayout="Flow">
                                        </asp:CheckBoxList>
                                        <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                                            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT [TagID], [TagName] FROM [Tags] ORDER BY [TagID] DESC">
                                        </asp:SqlDataSource>
                                        <div class="space">
                                        </div>
                                    </asp:Panel>
                                    <asp:Button ID="btntagimage" runat="server" Height="31px" Text="Tag Image" Width="106px"
                                        CssClass="buttons" />
                                    <br />
                                </div>
                                <div class="newTags">
                                    <h2 class="headline5">
                                        Add new Tags</h2>
                                    <br />
                                    To create a new tag, simply enter your tag name and click on Add.<br />
                                    <br />
                                     <asp:TextBox ID="txtnewtag" runat="server" Width="252px"></asp:TextBox>
                                    <br />
                                    <asp:Button ID="btnaddnewtag" runat="server" Height="30px" Text="Add New Tag" Width="116px"
                                        CssClass="buttons"  />
                                </div>
                            </div>
                        </div>
                    </div>
            </div>
        </div>
    </div>
    </div>
    <h2 class="headline5">
        User Comments for this Image
    </h2>
    <br />
    <div>
        <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource2">
            <AlternatingItemTemplate>
                <span style=""><strong>Comment:</strong> <span style="color: #3366FF">
                    <asp:Label ID="CommentBodyLabel" runat="server" Text='<%# Eval("CommentBody") %>' />
                </span>
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel0" runat="server" Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel0" runat="server" Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    <strong>Comment Posted by:</strong> <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <br />
                </span>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <span style=""><strong>Comment:</strong> <span style="color: #3366FF">
                    <asp:TextBox ID="CommentBodyTextBox" runat="server" Text='<%# Bind("CommentBody") %>' />
                </span>
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:TextBox ID="DateUploadedTextBox1" runat="server" Text='<%# Bind("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:TextBox ID="TimeUploadedTextBox1" runat="server" Text='<%# Bind("TimeUploaded") %>' />
                    <br />
                    <strong>Comment Posted by</strong> <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <asp:Button ID="UpdateButton0" runat="server" CommandName="Update" Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                    <br />
                    <br />
                </span>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <span>No data was returned.</span>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <span style=""><strong>Comment:</strong> <span style="color: #3366FF">
                    <asp:TextBox ID="CommentBodyTextBox0" runat="server" Text='<%# Bind("CommentBody") %>' />
                </span>
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:TextBox ID="DateUploadedTextBox2" runat="server" Text='<%# Bind("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:TextBox ID="TimeUploadedTextBox2" runat="server" Text='<%# Bind("TimeUploaded") %>' />
                    <br />
                    <strong>Comment Posted by:</strong> <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <asp:Button ID="InsertButton0" runat="server" CommandName="Insert" Text="Insert" />
                    <asp:Button ID="CancelButton0" runat="server" CommandName="Cancel" Text="Clear" />
                    <br />
                    <br />
                </span>
            </InsertItemTemplate>
            <ItemTemplate>
                <span style=""><strong>Comment:</strong> <span style="color: #3366FF">
                    <asp:Label ID="CommentBodyLabel0" runat="server" Text='<%# Eval("CommentBody") %>' />
                </span>
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel1" runat="server" Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel1" runat="server" Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    <strong>Comment Posted by:</strong> <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <br />
                </span>
            </ItemTemplate>
            <LayoutTemplate>
                <div id="itemPlaceholderContainer" runat="server" style="">
                    <span runat="server" id="itemPlaceholder" />
                </div>
                <div style="">
                </div>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <span style="">CommentBody: <span style="color: #3366FF">
                    <asp:Label ID="CommentBodyLabel1" runat="server" Text='<%# Eval("CommentBody") %>' />
                </span>
                    <br />
                    DateUploaded:
                    <asp:Label ID="DateUploadedLabel2" runat="server" Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    TimeUploaded:
                    <asp:Label ID="TimeUploadedLabel2" runat="server" Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    UserName: <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <br />
                </span>
            </SelectedItemTemplate>
        </asp:ListView>
        <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="4">
            <Fields>
                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
                    ShowPreviousPageButton="False" />
                <asp:NumericPagerField />
                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
                    ShowPreviousPageButton="False" />
            </Fields>
        </asp:DataPager>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT Image_Comments.CommentBody, Image_Comments.DateUploaded, Image_Comments.TimeUploaded, aspnet_Users.UserName, Image_Comments.ImageID, Image_Comments.ImageCommentID FROM (Image_Comments INNER JOIN aspnet_Users ON Image_Comments.UserID = aspnet_Users.UserId) WHERE (Image_Comments.ImageID = ?) ORDER BY Image_Comments.ImageCommentID DESC">
            <SelectParameters>
                <asp:QueryStringParameter Name="?" QueryStringField="id" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT [ImageLink] FROM [Images] WHERE ([ImageID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ImageID" QueryStringField="id" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
